<?php
$login = array(
	'name'	=> 'login',
	'value' => set_value('login'),
        'placeholder' => 'E-Mail o Usuario',
        'id' => 'inputEmail'
);
if ($login_by_username AND $login_by_email) {
	$login_label = 'E-Mail o Usuario:';
} else if ($login_by_username) {
	$login_label = 'Usuario:';
} else {
	$login_label = 'E-Mail:';
}
$password = array(
	'name'	=> 'password',
	'id'	=> 'inputPassword',
        'placeholder' => 'Constraseña'
);
$remember = array(
	'name'	=> 'remember',
	'id'	=> 'remember',
	'value'	=> 1,
	'checked'	=> set_value('remember')
);
$captcha = array(
	'name'	=> 'captcha',
	'id'	=> 'captcha',
	'maxlength'	=> 8,
);
$form_atributes = array('class' => 'form-horizontal');
$login_label_atributes=array('class' => 'control-label');
$password_label_atributes=array('class' => 'control-label');
$checkbox_label_atributes=array('class' => 'checkbox');
$form_submit_atritubes=array('class' => 'btn btn-primary','name'=>'submit','value' => 'Ingresar')
?>

 <div class="span5 offset3">
    
  
     
<br>
<br>
<br>
<br>
<br>
     

     <?php echo form_error($login['name'],'<div class="alert alert-error">','</div>'); ?>
     <?php echo form_error($password['name'],'<div class="alert alert-error">','</div>'); ?>
     <?php echo form_error($captcha['name'],'<div class="alert alert-error">','</div>'); ?>
     
    <?php if(isset($errors[$login['name']])): ?>
    <div class="alert alert-error">
        <?php echo $errors[$login['name']]?>
    </div>
    <?php endif ?>

    <?php if(isset($errors[$password['name']])): ?>
    <div class="alert alert-error">
        <?php echo $errors[$password['name']] ?>
    </div>
    <?php endif ?>

     
    <?php echo form_open($this->uri->uri_string(),$form_atributes); ?>
    <div class="control-group">
        <?php echo form_label($login_label, $login['id'],$login_label_atributes); ?>
        <div class="controls">
        <?php echo form_input($login); ?>
        </div>
    </div>
      <div class="control-group">
        <?php echo form_label('Contraseña:', $password['id'],$password_label_atributes); ?>
        <div class="controls">
            <?php echo form_password($password); ?>
        </div>
    </div>
	<?php if ($show_captcha) : ?>
		<?php if ($use_recaptcha) : ?>
			<div id="recaptcha_image"></div>
			<a href="javascript:Recaptcha.reload()">Refrescar/a>
			<div class="recaptcha_only_if_image"><a href="javascript:Recaptcha.switch_type('audio')">Get an audio CAPTCHA</a></div>
			<div class="recaptcha_only_if_audio"><a href="javascript:Recaptcha.switch_type('image')">Get an image CAPTCHA</a></div>

			<div class="recaptcha_only_if_image">Ingrese las siguientes palabras</div>
			<div class="recaptcha_only_if_audio">Introduzca los números que oyes</div>

                        <input type="text" id="recaptcha_response_field" name="recaptcha_response_field" /></td>
                        <?php echo form_error('recaptcha_response_field'); ?></td>
                        <?php echo $recaptcha_html; ?>
	
                <?php  else : ?>

                        <div class="control-group">                            
                            <div class="controls">
                                <p>Ingrese el código exactamente como aparece:</p>
                            </div>
                            <div class="controls">
                                <?php echo $captcha_html; ?>
                            </div>
                            <div class="controls">
                                 <?php echo form_label('Confirmacion de código:', $captcha['id']); ?></td>
                            </div>
                            <div class="controls">
                                <?php echo form_input($captcha); ?>
                            </div>
                        </div>

                        

                <?php endif;?>

	<?php endif ?>
                     <div class="control-group">
                         <div class="controls">
                              <?php echo form_label( form_checkbox($remember).'Recordarme', $remember['id'],$checkbox_label_atributes); ?>
                         </div>
                         <div class="controls">
                             <?php echo form_submit($form_submit_atritubes); ?>
                        </div>
                     </div>
                     <div class="control-group">
                         <div class="controls">
                         <?php echo anchor('/auth/forgot_password/', '¿Olvido su contraseña?'); ?>
                         <?php if ($this->config->item('allow_registration', 'tank_auth')) echo anchor('/auth/register/', '¿Registrate?'); ?>
                         </div>
                     </div>

<?php echo form_close(); ?>
  </div>